// Defs.h

#pragma once
#ifndef DEFS_H_DEFINED
#define DEFS_H_DEFINED

typedef unsigned char byte;
typedef unsigned short word;
typedef unsigned long dword;
typedef unsigned __int64 qword;
typedef __int8  int8;
typedef __int16 int16;
typedef __int32 int32;
typedef __int64 int64;
typedef unsigned __int8  uint8;
typedef unsigned __int16 uint16;
typedef unsigned __int32 uint32;
typedef unsigned __int64 uint64;


template<class CObj>
const CObj& Min(const CObj& xV1, const CObj& xV2)
{
	if(xV1<xV2){return xV1;}else{return xV2;};
};

template<class CObj>
const CObj& Max(const CObj& xV1, const CObj& xV2)
{
	if(xV1<xV2){return xV2;}else{return xV1;};
};

template<class CObj>
const CObj& Clamp(const CObj& xV,const CObj& xMin, const CObj& xMax)
{
	if(xV<xMin){return xMin;}
	else if(xV>xMax){return xMax;}
	else {return xV;};
};

template<class CObj>
void Swap(CObj& xObj1, CObj& xObj2) 
{
	CObj xTemp = xObj1;xObj1 = xObj2;xObj2 = xTemp;
};

static const double PI2=6.28318530718;
static const float PI2F=6.28318530718f;
static const double PI=3.14159265359;
static const float PIF=3.14159265359f;
static const double PIHALF=1.5707963268;
static const float PIHALFF=1.5707963268f;
static const double PIQUATER=0.7853981633975;
static const float PIQUATERF=0.7853981633975f;
static const double PI3QUATER=2.356194490192;
static const float PI3QUATERF=2.356194490192f;
static const double PI15=4.712388980385;
static const float PI15F=4.712388980385f;

static const double SQRT2=1.41421356237;
static const float SQRT2F=1.41421356237f;
static const double SQRT05=0.707106781187;
static const float SQRT05F=0.707106781187f;


#endif // DEFS_H_DEFINED
